home *** CD-ROM | disk | FTP | other *** search
- Path: newsjunkie.ans.net!butch!news
- From: "William Z. Tang" <tangb@tccs2.ssd.lmsc.lockheed.com>
- Newsgroups: comp.lang.c++
- Subject: gettimeofday call in C++
- Date: Thu, 11 Jan 1996 17:04:13 -0800
- Organization: 73-16
- Message-ID: <30F5B38D.1E8B@tccs2.ssd.lmsc.lockheed.com>
- NNTP-Posting-Host: woodall.ssd.lmsc.lockheed.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b2 (X11; I; SunOS 5.4 sun4m)
-
- I am on a Solaris 2.4 machine running SUN's Visual Workshop for C++.
-
- When I compiled the following codes (inside a large C++ program)
- with CC (C++ compiler), the compiler gives me :
- "test.c", line 11: Error: Too few arguments in call to
- gettimeofday(timeval*, void*).
-
- But this code works fine with the regular C compiler.
- Anybody know what's the deal??
-
-
- #include <sys/time.h>
- #include <stdio.h>
- #include <time.h>
-
- main()
- {
- static char message[100];
- static struct timeval times;
-
-
- gettimeofday(×);
- cftime (message,"%C",(time_t *) ×.tv_sec);
- strcat (message,"testing message ");
- puts (message);
- }
-
-
-
-
- William Z. Tang
- tangb@tccs2.ssd.lmsc.lockheed.com
- B104 (408) 743-7098
-